package com.example.administrator.text;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.FrameLayout;
import android.widget.ListView;
import java.util.ArrayList;
import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;
import util.HomeUtil;
import util.JumpActivityUtils;
import util.Url;

/**
 * 客服
 */
public class ReportActivity extends AppCompatActivity {
    private ArrayList<String> mList = new ArrayList<>();

    @Bind(R.id.activity_report_frame)
    FrameLayout mFrameLoayout;
    @Bind(R.id.activity_report_list)
    ListView mListView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_report);
        ButterKnife.bind(this);
        init();
    }

    private void init() {
        HomeUtil.getHemeUtilNew().getStatusBar(this, mFrameLoayout);
        ArrayAdapter<String> adapter = new ArrayAdapter<>(
                this,
                R.layout.adapter_setnet_list,
                R.id.adapter_list_tv_name,
                getData());
        mListView.setAdapter(adapter);

        mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                switch (position){
                    case 0:
                        JumpActivityUtils.getInstance().jumpWebView(ReportActivity.this, Url.getUrlNew().Customer,"客服");
                        break;
                    case 1:
                        JumpActivityUtils.getInstance().jumpAbout(ReportActivity.this);
                        break;
                    case 2:
                        JumpActivityUtils.getInstance().jumpSetNetFiItem(ReportActivity.this);
                        break;
                }
            }
        });
    }

    /**
     * 返回
     */
    @OnClick(R.id.activity_report_ll)
    void getFinish(){
        finish();
    }


    private ArrayList<String> getData()
    {
        mList.add("客服");
        mList.add("意见反馈");
        mList.add("常见问题");
        return mList;
    }
}
